package vn.com.baseapplication;

import vn.com.baseapplication.network.BaseNetwork;
import vn.com.baseapplication.network.NetworkHandlerCallback;
import vn.com.baseapplication.service.BaseReceiver;
import vn.com.baseapplication.service.BaseReceiverListener;
import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.support.v4.app.Fragment;

public abstract class BaseFragment extends Fragment implements NetworkHandlerCallback,BaseReceiverListener{
	public static final String TAG = BaseFragment.class.getName();
	
	protected BaseActivity mActivity;
	protected BaseNetwork network;
	private BaseReceiver baseReceiver = new BaseReceiver(this);
	
	@Override
	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		network = new BaseNetwork(getActivity(),this);
	}
	@Override
	public void onDestroy() {
		// TODO Auto-generated method stub
		super.onDestroy();
	}
	@Override
	public void onResume() {
		super.onResume();
	}
	
	@Override
	public void onPause() {
		super.onPause();
	}
	
	@Override
	public void onNetLoading(int requestId) {
		
	}
	
	@Override
	public void onNetSuccess(int requestId, String response) {
		
	}
	
	@Override
	public void onNetSuccessCache(int requestId, String response) {
		
	}
	
	@Override
	public void onNetFailed(int requestId, String error) {
		
	}
	
	@Override
	public void onNetTimeOut(int requestId, Throwable error) {
		
	}
	
	@Override
	public void sendBaseBroadcast(Context context, Intent intent) {
		baseReceiver.sendBaseBroadcast(context, intent);
	}
	
	@Override
	public void onReceive(Context context, Intent intent) {
		
	}
	
	public void onServiceConnected(){
		
	}
}
